package com.chenxingnet.service;

import javax.annotation.Resource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import com.chenxingnet.dao.PopularizeEarningsDAO;
import com.chenxingnet.dto.*;

@Service("popularizeEarningsService")
@Transactional(rollbackFor=Exception.class)
@SuppressWarnings("all")
public class PopularizeEarningsService{
	@Resource(name="popularizeEarningsDAO")
	private PopularizeEarningsDAO popularizeEarningsDAO = null;
	
	public void test(){
		System.out.println(popularizeEarningsDAO.findByProperty(new HashMap()));
		System.out.println("TEST SUCCESS!!!");
	}
	
	public void create(PopularizeEarnings entity){
		popularizeEarningsDAO.insert(entity);
	}
	
	public void update(PopularizeEarnings entity){
		popularizeEarningsDAO.update(entity);
	}
	
	public void delete(Integer peid){
		popularizeEarningsDAO.delete(peid);
	}
	
	public PopularizeEarnings findById(Integer peid){
		return popularizeEarningsDAO.findById(peid);
	}
	
	public List<Map> findByProperty(Map params){
		return popularizeEarningsDAO.findByProperty(params);
	}
	
	public Long countByProperty(Map params){
		return popularizeEarningsDAO.countByProperty(params);
	}
	
	public static void main(String[] args) {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
		PopularizeEarningsService bean = (PopularizeEarningsService)ctx.getBean("popularizeEarningsService");
		bean.test();
	}
	
}
